import apiClient from '@/http/apiClient';
import { url } from 'inspector';

export enum OrgApi {
  Org = 'http://42.193.113.4:9091/v1/hp',
  Search = 'http://42.193.113.4:9091/v1/search',
  Detail = 'http://42.193.113.4:9091/v1/detail',
  allDetail = 'http://42.193.113.4:9091/v1/all_p',
  question = 'http://42.193.113.4:9091/api/insert_problem'
}

// 查询首页接口
const getHomeList = () => apiClient.post({ url: OrgApi.Org });

const SearchList = (data: any) => apiClient.post({ url: OrgApi.Search + `?code=${data.code}&pageNum=${data.page}&pageSize=${data.size}` })

const getDetail = (data: any) => apiClient.post({ url: OrgApi.Detail + `?id=${data.id}` })

const allDetail = (data: any) => apiClient.post({ url: OrgApi.allDetail + `?typeId=${data.id}&pageNum=${data.page}&pageSize=${data.size}` })


const saveQuestion = (data: any) => apiClient.post({
  url: OrgApi.question, data
})

export default {
  getHomeList,
  SearchList,
  getDetail,
  allDetail,
  saveQuestion
}